home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CTOOLS10.ARJ / STACK.H < prev    next >
C/C++ Source or Header  |  1991-12-31  |  2KB  |  61 lines

  1. /****************************************************************************
  2. *
  3. *                    Copyright (C) 1991 Kendall Bennett.
  4. *                            All rights reserved.
  5. *
  6. * Filename:        $RCSfile: stack.h $
  7. * Version:        $Revision: 1.2 $
  8. *
  9. * Language:        ANSI C
  10. * Environment:    any
  11. *
  12. * Description:    Header file for linked stack routines. Basically all we
  13. *                do is provide a set of macros that access the linked list
  14. *                routines.
  15. *
  16. * $Id: stack.h 1.2 91/12/31 19:41:28 kjb Exp $
  17. *
  18. * Revision History:
  19. * -----------------
  20. *
  21. * $Log:    stack.h $
  22. * Revision 1.2  91/12/31  19:41:28  kjb
  23. * Modified include file directories.
  24. * Revision 1.1  91/09/01  17:32:08  ROOT_DOS
  25. * Initial revision
  26. ****************************************************************************/
  27.  
  28. #ifndef    __STACK_H
  29. #define    __STACK_H
  30.  
  31. #ifndef    __LIST_H
  32. #include "list.h"
  33. #endif
  34.  
  35. /*---------------------- Macros and type definitions ----------------------*/
  36.  
  37. /* Macros that convert the stack types to list types        */
  38.  
  39. #define    STK_BUCKET    LST_BUCKET
  40. #define    STACK        LIST
  41.  
  42. /* Macros to map the list macros                            */
  43.  
  44. #define    STK_USERSPACE    LST_USERSPACE
  45. #define    STK_HEADER        LST_HEADER
  46. #define    STK_EMPTY(s)    LST_EMPTY(s)
  47.  
  48. /* Macros to map the stack routines onto the list routines    */
  49.  
  50. #define    stk_newnode        lst_newnode
  51. #define    stk_freenode    lst_freenode
  52. #define    stk_init        lst_init
  53. #define    stk_kill        lst_kill
  54.  
  55. #define    stk_push(s,n)    lst_insertafter(s,n,LST_HEAD(s))
  56. #define    stk_pop(s)        lst_deletenext(s,LST_HEAD(s))
  57.  
  58. #endif
  59.